package cn.mesmile.order.fallback;

import cn.mesmile.order.dto.Product;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @author zb
 * @date 2020/12/16 11:38
 * @Description
 */
@FeignClient(name = "xdclass-seata-product", fallbackFactory = ProductServiceClientFallbackFactory.class)
public interface ProductServiceClient {

    /**
     *  获取产品
     * @return
     */
    @GetMapping("/api/v1/product/get")
    String get();

    /**
     *  获取产品
     * @return
     */
    @GetMapping("/api/v1/product/getProduct/{productId}")
    Product getProduct(@PathVariable("productId")Long productId);

    /**
     *  修改库存
     * @param productId
     * @param number
     * @return
     */
    @GetMapping("/api/v1/product/update/{productId}/{number}")
    Boolean update(@PathVariable("productId")Long productId, @PathVariable("number")Long number);

}
